STEP 2: Next, we need the other part of a Caesar Cipher encryption: the encryption key!

The .ask() code will always store user input as a string! To convert a string to an integer, we use int().

  • From GRAPHICS and , drag another Stage Ask into the program.
  • Change the input variable from choice to key. Edit the string in .ask() to "Enter an encryption key!"
  • Go to LOGIC and . Drag out Convert to Integer and change both my_var to key.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)